package com.bipoernode.crm;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * ClassName:test03
 * package:com.bipoernode.crm
 * Description:
 *
 * @date: 2022-06-06 22:22
 * @author：lin
 */
public class test03 {
    public static void main(String[] args) throws IOException {
       HSSFWorkbook workbook= new HSSFWorkbook();
        HSSFSheet sheet= workbook.createSheet();
        HSSFRow row= sheet.createRow(0);
        HSSFCell cell= row.createCell(0);


        cell.setCellValue("学号");
         cell= row.createCell(1);
        cell.setCellValue("姓名");
         cell= row.createCell(2);
        cell.setCellValue("学号");

        for (int i=1 ;i<11;i++){
            row= sheet.createRow(i);
            cell= row.createCell(0);
            cell.setCellValue("100"+i);
            cell= row.createCell(1);
            cell.setCellValue("name"+i);
            cell= row.createCell(2);
            cell.setCellValue("1000"+i);


        }




        OutputStream os = new FileOutputStream("C:\\Users\\81263\\Desktop\\java软件\\测试文件.xls");
        workbook.write(os);

        os.close();
        workbook.close();



    }
}
